package com.kdd.campus.sh.service.impl;

import com.kdd.campus.sh.dao.ShFavoriteMapper;
import com.kdd.campus.sh.po.ShFavorite;
import com.kdd.campus.sh.service.ShFavoriteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Auther: fcp
 * @Date: 2020/2/28 11:12
 * @Description:
 */
@Service
public class ShFavoriteServiceImpl implements ShFavoriteService {
    @Autowired
    private ShFavoriteMapper shFavoriteDao;

    @Override
    public boolean isFavorite(Long userId, Long pId) {
        ShFavorite shFavorite = new ShFavorite();
        shFavorite.setUserid(userId);
        shFavorite.setPid(pId);
        return  shFavoriteDao.selectCount(shFavorite) > 0;
    }
}
